package com.yssw.client.service.impl;

import java.util.List;
import com.yssw.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yssw.client.mapper.CheckReportMapper;
import com.yssw.client.domain.CheckReport;
import com.yssw.client.service.ICheckReportService;

/**
 * 检查报告Service业务层处理
 * 
 * @author yssw
 * @date 2023-04-01
 */
@Service
public class CheckReportServiceImpl implements ICheckReportService 
{
    @Autowired
    private CheckReportMapper checkReportMapper;

    /**
     * 查询检查报告
     * 
     * @param id 检查报告主键
     * @return 检查报告
     */
    @Override
    public CheckReport selectCheckReportById(Long id)
    {
        return checkReportMapper.selectCheckReportById(id);
    }

    /**
     * 查询检查报告列表
     * 
     * @param checkReport 检查报告
     * @return 检查报告
     */
    @Override
    public List<CheckReport> selectCheckReportList(CheckReport checkReport)
    {
        return checkReportMapper.selectCheckReportList(checkReport);
    }

    /**
     * 新增检查报告
     * 
     * @param checkReport 检查报告
     * @return 结果
     */
    @Override
    public int insertCheckReport(CheckReport checkReport)
    {
        checkReport.setCreateTime(DateUtils.getNowDate());
        return checkReportMapper.insertCheckReport(checkReport);
    }

    /**
     * 修改检查报告
     * 
     * @param checkReport 检查报告
     * @return 结果
     */
    @Override
    public int updateCheckReport(CheckReport checkReport)
    {
        checkReport.setUpdateTime(DateUtils.getNowDate());
        return checkReportMapper.updateCheckReport(checkReport);
    }

    /**
     * 批量删除检查报告
     * 
     * @param ids 需要删除的检查报告主键
     * @return 结果
     */
    @Override
    public int deleteCheckReportByIds(Long[] ids)
    {
        return checkReportMapper.deleteCheckReportByIds(ids);
    }

    /**
     * 删除检查报告信息
     * 
     * @param id 检查报告主键
     * @return 结果
     */
    @Override
    public int deleteCheckReportById(Long id)
    {
        return checkReportMapper.deleteCheckReportById(id);
    }
}
